<!DOCTYPE html>
<html>
<head>
    <title>代理管理</title>
    {{template "inc/mate.html" .}}
    {{template "inc/easyui_css.html" .}}
<style type="text/css">
	.span_left:{
		padding-right: 10px;
		padding-left: 10px;
		line-height: 30px;
		width: 85px;
	}
	.span_right{
		margin-left: 15px;
		padding-left: 10px;
		line-height: 30px;
	}
</style>
    {{template "inc/ie_supper.html" .}}
</head>
<body class="easyui-layout">
		<div data-options="region:'north'" style="height:50px;padding: 10px;">
			{{if authas "/agent/mem/toAdd" .PhyAuths}}
				<a href="{{.baseUrl}}/agent/mem/toAdd" class="easyui-linkbutton" style="border-color: #4cae4c; background-image: linear-gradient(rgb(76,174,76) 0px, rgb(68,157,68) 100%);">添加会员</a>
			{{end}}
			<!--<a href="{{.baseUrl}}/agent/basefun/toUploadImg" class="easyui-linkbutton" style="border-color: #4cae4c; background-image: linear-gradient(rgb(76,174,76) 0px, rgb(68,157,68) 100%);">上传图片</a>-->
		</div>
		<div data-options="region:'center'">
			<table id="dg" class="easyui-datagrid" style="width:100%;height:100%" data-options="url:'{{.baseUrl}}/agent/mem/findMems',singleSelect:true,collapsible:true,method:'post',pagination:true,pageList:[15,20,25,30],pageSize:15">
		     	<thead>
		            <tr>
		            	<th data-options="field:'memId',hidden:true"></th>
		                <th data-options="field:'memName',align:'left'">姓名</th>
		                <th data-options="field:'memPhone',align:'left'">电话</th>
		                <th data-options="field:'showBirthDate',align:'left'">生日</th>
		                <th data-options="field:'memSex',align:'left'">性别</th>
		                <th data-options="field:'memHeight',align:'left'">身高</th>
		                <th data-options="field:'memEducation',align:'left'">学历</th>
		                <th data-options="field:'memJob',align:'left'">工作</th>
		                <th data-options="field:'memIncome',align:'left'">收入(单位:K)</th>
		                <th data-options="field:'memHouse',align:'left'">是否有房</th>
		                <th data-options="field:'memCar',align:'left'">是否有车</th>
		                <th data-options="field:'showAddTime',align:'left'">添加时间</th>
		                <th data-options="field:'memStatus',align:'left',hidden:true">状态</th>
		            </tr>
		        </thead>

		    </table>
		</div>
		<div id="dlg" class="easyui-dialog" data-options="closable: true,closed:true,draggable:false,resizable:false,modal:true" style="width:650px;padding:20px 20px; height:620px; ">
			
    	</div>
</body>
</html>
{{template "inc/easyui_js.html" .}}
<script type="text/javascript" charset="UTF-8">
$(document).ready(function(){
	$('#dg').datagrid({
		onDblClickCell: function(index,row){
			var mem = $('#dg').datagrid('getSelected');
			
			$.ajax({
				async:false,
				data:{memId:mem.memId},
				dataType:'json',
				success:function(data){
					if (data.result) {
						var tmp_mem=data.memData;

						var tmp_content='<span class="span_left">姓&nbsp;&nbsp;&nbsp;&nbsp;名：&nbsp;&nbsp;</span><span class="span_right">'+tmp_mem.memName+'</span>';
						tmp_content+='<br /><span class="span_left">手&nbsp;机&nbsp;号：&nbsp;</span><span class="span_right">'+tmp_mem.memPhone+'</span>';
						tmp_content+='<br /><span class="span_left">出生日期：</span><span class="span_right">'+tmp_mem.showBirthDate+'</span>';
						tmp_content+='<br /><span class="span_left">微&nbsp;信&nbsp;号：&nbsp;</span><span class="span_right">'+tmp_mem.memWxCode+'</span>';
						tmp_content+='<br /><span class="span_left">QQ&nbsp;&nbsp;&nbsp;&nbsp;号：&nbsp;</span><span class="span_right">'+tmp_mem.memQqCode+'</span>';
						tmp_content+='<br /><span class="span_left">性&nbsp;&nbsp;&nbsp;&nbsp;别：&nbsp;</span><span class="span_right">'+tmp_mem.memSex+'</span>&nbsp;&nbsp;&nbsp;&nbsp;<span class="span_left">身高：</span><span class="span_right">'+tmp_mem.memHeight+'cm</span>&nbsp;&nbsp;&nbsp;&nbsp;<span class="span_left">学历：</span><span class="span_right">'+tmp_mem.memEducation+'</span>';
						tmp_content+='<br /><span class="span_left">工&nbsp;&nbsp;&nbsp;&nbsp;作：&nbsp;</span><span class="span_right">'+tmp_mem.memJob+'</span>&nbsp;&nbsp;&nbsp;&nbsp;<span class="span_left">收入：</span><span class="span_right">'+tmp_mem.memIncome+'K</span>';
						tmp_content+='<br /><span class="span_left">居&nbsp;住&nbsp;地：</span><span class="span_right">'+tmp_mem.showLiveRegionCode+'</span>';
						tmp_content+='<br /><span class="span_left">户&nbsp;籍&nbsp;地：</span><span class="span_right">'+tmp_mem.showCensusRegionCode+'</span>';
						tmp_content+='<br /><span class="span_left">资&nbsp;&nbsp;&nbsp;&nbsp;产：&nbsp;</span><span class="span_right">'+tmp_mem.memHouse+'房&nbsp;&nbsp;'+tmp_mem.memCar+'车</span>';
						tmp_content+='<br /><span class="span_left">要&nbsp;&nbsp;&nbsp;&nbsp;求：&nbsp;</span><span class="span_right">'+tmp_mem.memRequirement+'</span>';
						tmp_content+='<br /><span class="span_left">标&nbsp;&nbsp;&nbsp;&nbsp;签：&nbsp;</span><span class="span_right">'+tmp_mem.mhowLabelIds+'</span>';
						tmp_content+='<br /><span class="span_left">自我介绍：</span>';
						tmp_content+='<br /><span class="span_right">'+tmp_mem.memEvaluation+'</span>';
						tmp_content+='<br /><span class="span_left">照&nbsp;&nbsp;&nbsp;&nbsp;片：&nbsp;&nbsp;</span><br />';
						var imgs=tmp_mem.memShowPics;
						if (imgs!=null&&imgs!=undefined&&imgs!=''){
							imgs=imgs.replace(',','" />&nbsp;<img width="100" height="100" src="');
							imgs='<img width="100" height="100" src="'+imgs+'"/>';
							tmp_content+=imgs
						}
						$('#dlg').dialog({
						    title: mem.MemName+'的详细信息',
						    content:tmp_content,
						    closable: true,
						    closed:true,
						    draggable:false,
						    resizable:false,
						    modal:true,
							onBeforeClose:function(){
								$('#dlg').panel('clear');
							}
						});
						$('#dlg').dialog('open').panel('refresh');
					}else{
						alert(data.msg);
					}
				},
				error:function (XMLHttpRequest, textStatus, errorThrown) {
					alert(textStatus);
				},
			  	type: "POST",
			  	url: "{{.baseUrl}}/agent/mem/detailed"
			});
		}
	});
});
</script>